package cn.gson.work.model.pojos;

import javax.persistence.*;
import java.util.Date;
import java.util.Objects;

@Entity
public class Application {
    private long appId;
    private long resId;
    private long userNo;
    private Date appOpenTime;
    private Date appEndTime;
    private String appRemark;
    private long appCar;
    private String appType;
    private Integer appPeople;
    private String appStart;
    private String appArrive;
    private String appDriver;
    private String appReason;
    private String appApprover;
    private String appStage;
    private String appIdea;
    private String appBack;
    private String appBackRemark;
    private Date backTime;
    private Date appTime;
    private Date appApproverTime;
    private User user;
    private Resource resource;
    private Car car;

    @ManyToOne
    @JoinColumn(name="app_car",insertable = false,updatable = false)
    public Car getCar() {
        return car;
    }

    public void setCar(Car car) {
        this.car = car;
    }

    @ManyToOne
    @JoinColumn(name="USER_NO",insertable = false,updatable = false)
    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    @ManyToOne
    @JoinColumn(name="RES_ID",insertable = false,updatable = false)
    public Resource getResource() {
        return resource;
    }

    public void setResource(Resource resource) {
        this.resource = resource;
    }

    @Id
    @Column(name = "APP_ID")
    public long getAppId() {
        return appId;
    }

    public void setAppId(long appId) {
        this.appId = appId;
    }

    @Basic
    @Column(name = "RES_ID")
    public long getResId() {
        return resId;
    }

    public void setResId(long resId) {
        this.resId = resId;
    }

    @Basic
    @Column(name = "APP_TIME")
    public Date getAppTime() {
        return appTime;
    }

    public void setAppTime(Date appTime) {
        this.appTime = appTime;
    }

    @Basic
    @Column(name = "APP_APPROVER_TIME")
    public Date getAppApproverTime() {
        return appApproverTime;
    }

    public void setAppApproverTime(Date appApproverTime) {
        this.appApproverTime = appApproverTime;
    }

    @Basic
    @Column(name = "BACK_TIME")
    public Date getBackTime() {
        return backTime;
    }

    public void setBackTime(Date backTime) {
        this.backTime = backTime;
    }

    @Basic
    @Column(name = "USER_NO")
    public long getUserNo() {
        return userNo;
    }

    public void setUserNo(long userNo) {
        this.userNo = userNo;
    }

    @Basic
    @Column(name = "APP_OPEN_TIME")
    public Date getAppOpenTime() {
        return appOpenTime;
    }

    public void setAppOpenTime(Date appOpenTime) {
        this.appOpenTime = appOpenTime;
    }

    @Basic
    @Column(name = "APP_END_TIME")
    public Date getAppEndTime() {
        return appEndTime;
    }

    public void setAppEndTime(Date appEndTime) {
        this.appEndTime = appEndTime;
    }

    @Basic
    @Column(name = "APP_REMARK")
    public String getAppRemark() {
        return appRemark;
    }

    public void setAppRemark(String appRemark) {
        this.appRemark = appRemark;
    }

    @Basic
    @Column(name = "APP_CAR")
    public long getAppCar() {
        return appCar;
    }

    public void setAppCar(long appCar) {
        this.appCar = appCar;
    }

    @Basic
    @Column(name = "APP_TYPE")
    public String getAppType() {
        return appType;
    }

    public void setAppType(String appType) {
        this.appType = appType;
    }

    @Basic
    @Column(name = "APP_PEOPLE")
    public Integer getAppPeople() {
        return appPeople;
    }

    public void setAppPeople(Integer appPeople) {
        this.appPeople = appPeople;
    }

    @Basic
    @Column(name = "APP_START")
    public String getAppStart() {
        return appStart;
    }

    public void setAppStart(String appStart) {
        this.appStart = appStart;
    }

    @Basic
    @Column(name = "APP_ARRIVE")
    public String getAppArrive() {
        return appArrive;
    }

    public void setAppArrive(String appArrive) {
        this.appArrive = appArrive;
    }

    @Basic
    @Column(name = "APP_DRIVER")
    public String getAppDriver() {
        return appDriver;
    }

    public void setAppDriver(String appDriver) {
        this.appDriver = appDriver;
    }

    @Basic
    @Column(name = "APP_REASON")
    public String getAppReason() {
        return appReason;
    }

    public void setAppReason(String appReason) {
        this.appReason = appReason;
    }

    @Basic
    @Column(name = "APP_APPROVER")
    public String getAppApprover() {
        return appApprover;
    }

    public void setAppApprover(String appApprover) {
        this.appApprover = appApprover;
    }

    @Basic
    @Column(name = "APP_STAGE")
    public String getAppStage() {
        return appStage;
    }

    public void setAppStage(String appStage) {
        this.appStage = appStage;
    }

    @Basic
    @Column(name = "APP_IDEA")
    public String getAppIdea() {
        return appIdea;
    }

    public void setAppIdea(String appIdea) {
        this.appIdea = appIdea;
    }

    @Basic
    @Column(name = "APP_BACK")
    public String getAppBack() {
        return appBack;
    }

    public void setAppBack(String appBack) {
        this.appBack = appBack;
    }

    @Basic
    @Column(name = "APP_BACK_REMARK")
    public String getAppBackRemark() {
        return appBackRemark;
    }

    public void setAppBackRemark(String appBackRemark) {
        this.appBackRemark = appBackRemark;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Application that = (Application) o;
        return appId == that.appId &&
                Objects.equals(appOpenTime, that.appOpenTime) &&
                Objects.equals(appEndTime, that.appEndTime) &&
                Objects.equals(appRemark, that.appRemark) &&
                Objects.equals(appCar, that.appCar) &&
                Objects.equals(appType, that.appType) &&
                Objects.equals(appPeople, that.appPeople) &&
                Objects.equals(appStart, that.appStart) &&
                Objects.equals(appArrive, that.appArrive) &&
                Objects.equals(appDriver, that.appDriver) &&
                Objects.equals(appReason, that.appReason) &&
                Objects.equals(appApprover, that.appApprover) &&
                Objects.equals(appStage, that.appStage) &&
                Objects.equals(appIdea, that.appIdea) &&
                Objects.equals(appBack, that.appBack) &&
                Objects.equals(appBackRemark, that.appBackRemark);
    }

    @Override
    public int hashCode() {
        return Objects.hash(appId, appOpenTime, appEndTime, appRemark, appCar, appType, appPeople, appStart, appArrive, appDriver, appReason, appApprover, appStage, appIdea, appBack, appBackRemark);
    }
}
